package com.itheima.config;

import com.itheima.utils.MinioUtil;
import io.minio.MinioClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = "minio")
public class MinioConfig {
    private String endpoint;

    private String accessKey;

    private String secretKey;

    private String bucketName;

    @Bean
    public MinioUtil creatMinioClient() {
        return new MinioUtil(endpoint, accessKey, secretKey, bucketName);
    }
}
